﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace StarClub.Web
{
    public partial class Test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btntest_Click(object sender, EventArgs e)
        {
            StarClub.BLL.Tsys_ErrorLog error = new StarClub.BLL.Tsys_ErrorLog();
            if (error.WriteErrorLog("测试Errinfo", "Errsource", "测试remarks"))
                Common.MessageBox.Show(Page, "测试成功");
            else
                Common.MessageBox.Show(Page, "测试失败");
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            StarClub.Model.star_user userModel = new StarClub.Model.star_user();
            userModel.Name = "testuser2";
            userModel.password = "123456";
            userModel.email = "test@email.com";
            userModel.Type = 1;
            StarClub.BLL.star_user userBll = new StarClub.BLL.star_user();
            if (userBll.Add(userModel))
                Common.MessageBox.Show(Page, "添加用户成功，ID为：" + userModel.UID);
            else
                Common.MessageBox.Show(Page, "添加用户失败");
        }
        //加密
        protected void Button2_Click(object sender, EventArgs e)
        {
            this.lblmsg2.Text =DBUtility.DESEncrypt.Encrypt(TextBox1.Text.Trim());
        }
        //解密
        protected void Button3_Click(object sender, EventArgs e)
        {
            this.lblmsg1.Text=DBUtility.DESEncrypt.Decrypt(this.txbpwd.Text.Trim());
        }
    }
}
